package com.unism.common.mybatis;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;

public interface UnismMapper<T>{
	 
     @InsertProvider(type = UnismProvider.class, method = "insert") 
	 public void add(T entity);
     
	 @DeleteProvider(type = UnismProvider.class, method = "delete") 
	 public void delete(T entity);
	 
	 @DeleteProvider(type = UnismProvider.class, method = "batchDelete") 
	 public int  batchDelete(@Param("entity")T entity,@Param("ids")List<Object> ids);
		  
	 @UpdateProvider(type = UnismProvider.class, method = "update") 
	 public void update(T entity);
	 
	 @SelectProvider(type = UnismProvider.class, method = "getAll") 
	 @ResultType(Map.class)
	 public List<Map<String, Object>> list(T entity);
}
